package com.hackerrank.challenges.utopiantree;

import java.util.Scanner;

public class Solution {
	private static long pow(long a, long b) {
		long c = 1, m = 0x8000;
		while(m > 0) {
			c *= c;
			if((b & m) > 0)
				c *= a;
			m = m >> 1;
		}
		return c;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		for(int t = 0; t < T; t++) {
			long N = in.nextInt(), a = pow(2, N / 2 + 1) - 1;
			if(N % 2 == 1)
				System.out.println(a * 2);
			else
				System.out.println(a);
		}
	}
}
